﻿#region Using

using System.Collections.Generic;

using GameCommon.FontHelper;

using Microsoft.Xna.Framework.Graphics;

#endregion

namespace GameCommon.Base
{
    public class Font
    {
        private readonly Dictionary<char, FontChar> chars;

        private FontFile file;

        public Font()
        {
            this.chars = new Dictionary<char, FontChar>();
        }

        public Dictionary<char, FontChar> Chars
        {
            get
            {
                return this.chars;
            }
        }

        public FontFile File
        {
            get
            {
                return this.file;
            }

            set
            {
                this.file = value;

                foreach (var fontCharacter in this.File.Chars)
                {
                    this.chars.Add((char)fontCharacter.ID, fontCharacter);
                }
            }
        }

        public Texture2D Texture { get; set; }
    }
}